
<%--
  Created by IntelliJ IDEA.
  User: moter-code01
  Date: 2020/10/12
  Time: 19:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html lang="zh">
<head>
    <title>Title</title>

</head>
<body>

<a href="index?request_locale=zh_CN">中文</a>
<a href="index?request_locale=en_US">英文</a>


<s:i18n name="i18n/loginResource">
    <h1><s:text name="welcome"/></h1>
    <form name="login" action="hello_" method="post" enctype="multipart/form-data">
        <s:text name="username"/>
        <input type="text" name="username"/> <br/>
        <s:text name="password"/><input type="password" name="password"/> <br/>
        <s:text name="birth"/><input type="text" name="birthDay"/> <br/>
        <s:text name="avatar"/><input type="file" name="avatar"> <br>
        <s:submit type="button" key="adminSubmit" onclick="adminLogin()"/>
        <s:submit type="button" key="userSubmit" onclick="userLogin()"/>

    </form>
</s:i18n>
<script>
    var action = document.login.action

    function adminLogin() {
        document.login.action = action.concat("admin!login")
        submit();
    }

    function userLogin() {
        document.login.action = action.concat("user!login")
        submit();
    }

    // 提交表单
    function submit() {
        document.login.submit();
    }
</script>
</body>
</html>
